import request from '@/config/axios'

// 标签 VO
export interface TagVO {
  id: number // 唯一自增id
  tagName: string // 签名名字
  classifyId: number // 分类id，0表示无分类
}

// 标签 API
export const TagApi = {
  // 查询标签分页
  getTagPage: async (params: any) => {
    return await request.get({ url: `/lm/tag/page`, params })
  },

  // 查询标签详情
  getTag: async (id: number) => {
    return await request.get({ url: `/lm/tag/get?id=` + id })
  },

  // 新增标签
  createTag: async (data: TagVO) => {
    return await request.post({ url: `/lm/tag/create`, data })
  },

  // 修改标签
  updateTag: async (data: TagVO) => {
    return await request.put({ url: `/lm/tag/update`, data })
  },

  // 删除标签
  deleteTag: async (id: number) => {
    return await request.delete({ url: `/lm/tag/delete?id=` + id })
  },

  // 导出标签 Excel
  exportTag: async (params) => {
    return await request.download({ url: `/lm/tag/export-excel`, params })
  }
}